$(document).ready(function(){
	$("#selcinemalch").mouseover(function(){
	/**** 20120111 add ***/	
		var yingyuanlist_h = $("#cinemasearchnew").height()/2;
		var yingyuanlist_y = 10 - yingyuanlist_h ;
		$("#cinemasearchnew").css("top",yingyuanlist_y);
		//alert(yingyuan_top);
	/*** 20120111 end ***/
	})
})

function kchangecity(kcityid)
{  $("#divmorecy").hide();
    $("#kchfilmname").html("选择电影");
    $("#kchcinemaname").html("选择影院");
    $("#kshow").html("");
    var kcityn="合肥";
   switch(kcityid)
		{
		   case "1":
		   kcityn="合肥";
		   break;
		   case "2":
		   kcityn="上海";
		   break;
		   case "3":
		   kcityn="深圳";
		   break;
		   case "4":
		   kcityn="广州";
		   break;
		   case "5":
		   kcityn="武汉";
		   break;
		}
	$("#yinchangecity2").html(kcityn+"[更换城市]");	
	kchangefilm(kcityid);
}
function kchangecity2(kcityid)
{  var kcityn="合肥";
   switch(kcityid)
		{
		   case "1":
		   kcityn="合肥";
		   break;
		   case "2":
		   kcityn="上海";
		   break;
		   case "3":
		   kcityn="深圳";
		   break;
		   case "4":
		   kcityn="广州";
		   break;
		   case "5":
		   kcityn="武汉";
		   break;
		}
	$("#yinchangecity2").html(kcityn+"[更换城市]");	
	
}
function showxiaoguo()
{
                    	/***** 20110909 *****/
    $(".topic").hover(function(){ //选择影片的
        $(this).parent().next().show();
    },function(event){
        $(this).parent().next().hide();
        event.stopPropagation();
    })
    $(".test_id").hover(function(){ //选择影片的
        $(this).parent().next().show();
    },function(event){
        $(this).parent().next().hide();
        event.stopPropagation();
    })

    $(".test_id2").hover(function(){ //选择影院的
        $(this).parent().next().show();
    },function(event){
        $(this).parent().next().hide();
        event.stopPropagation();
    })

    $(".today").hover(function(){ //电影时间的
        $(this).children().show();
    },function(event){
        $(this).children().hide();
        event.stopPropagation();
    })
	                    /***** 20110909 *****/


}
function kchangefilm2(kcityid) {

    alert("kfilm2");
    $("#kfilm").html("");
    $.ajax({type:'POST',url:'/Users/indexsearchyin.html',data:{"kcityid":kcityid,"sort":"1"},
            success:function(data){
              if(data!="-1")
              {
                 $("#kfilm").html(data);
                 showxiaoguo();
              }
    }
    });
    
}
function kchangefilm(kcityid) {
    alert("kfilm1");
    $("#kfilm").html("");
    $.ajax({type:'POST',url:'/Users/indexsearchyin.html',data:{"kcityid":kcityid,"sort":"1"},
            success:function(data){
              if(data!="-1")
              {
                 $("#kfilm").html(data);
                 showxiaoguo();
              }
    }
    });
    $("#moviesearchnew").show();
}
function kshowfilmofcinema(cinemaindex,cinemaname) {

    alert("kfilm3");
     $("#kshow").html("请先选择影片");
    $("#kchfilmname").html('选择影片');
    $("#kchcinemaname").html(cinemaname);
    $("#cinemasearchnew").hide();
    $("#kfilm").html("");
    $.ajax({type:'POST',url:'/Users/indexsearchyin.html',data:{"cinemaindex":cinemaindex,"sort":"5"},
            success:function(data){
              if(data!="-1")
              {
                 $("#kfilm").html(data);
                 showxiaoguo();
              }
    }
    });
    //$("#moviesearchnew").show();
}

function kchangecinema2(kcityid)
{   $("#kcinema").html("");
    
    
    
    
    $.ajax({type:'POST',url:'/Users/indexsearchyin.html',data:{"kcityid":kcityid,"sort":"4"},
            success:function(data){
              if(data!="-1")
              {
                 $("#kcinema").html(data);
                 showxiaoguo();
              }
    }
    });
    
}

function kchangecinema(kcityid,kfilmid,kfilmname)
{   $("#kshow").html("请先选择影院");
$("#kchcinemaname").html('选择影院');
    $("#kcinema").html("");
    //$("#cinemasearchnew").show();
    $("#kchfilmname").html(kfilmname);
    $("#kchfilmname").css("color","#336699");
    $("#moviesearchnew").hide();
    
    $.ajax({type:'POST',url:'/Users/indexsearchyin.html',data:{"kcityid":kcityid,"kfilmid":kfilmid,"sort":"2"},
            success:function(data){
              if(data!="-1")
              {
                 $("#kcinema").html(data);
                 showxiaoguo();
              }
    }
    });
    
}
function kchangeshow(kfilmid,kcinemaid,kcinemaname)
{   $("#kshow").html("正在加载");
    $("#kchcinemaname").html(kcinemaname);
    $("#kchcinemaname").css("color","#336699");
    $("#cinemasearchnew").hide();
    $.ajax({type:'POST',url:'/Users/indexsearchyin.html',data:{"kcinemaid":kcinemaid,"kfilmid":kfilmid,"sort":"3"},
            success:function(data){
              if(data!="-1")
              {
                 $("#kshow").html(data);
                 showxiaoguo();
              }
    }
    });
    //$("#ktimesearchnew").show();
}
function kchangeshow2(kfilmid,kcinemaid,kfilmname) {   
    $("#kshow").html("正在加载");
    $("#kchfilmname").html(kfilmname);
    $("#moviesearchnew").hide();
    $.ajax({type:'POST',url:'/Users/indexsearchyin.html',data:{"kcinemaid":kcinemaid,"kfilmid":kfilmid,"sort":"3"},
            success:function(data){
              if(data!="-1")
              {
                 $("#kshow").html(data);
                 showxiaoguo();
              }
    }
    });
    //$("#ktimesearchnew").show();
}


function setCookie(name, value, expires, path) {
    if (!expires) expires = -1;
    if (!path) path = "/";
    var d = "" + name + "=" + value;

    var e;
    if (expires < 0) {
        e = "";
    }
    else if (expires == 0) {
        var f = new Date(1970, 1, 1);
        e = ";expires=" + f.toUTCString();
    }
    else {
        var now = new Date();
        var f = new Date(now.getTime() + expires * 60 * 60 * 1000);
        e = ";expires=" + f.toUTCString();
    }


    document.cookie = name + "=" + value + ";path=" + path + e;
}

function getCookie(c_name) {
    if (document.cookie.length > 0) {
        c_start = document.cookie.indexOf(c_name + "=")
        if (c_start != -1) {
            c_start = c_start + c_name.length + 1
            c_end = document.cookie.indexOf(";", c_start)
            if (c_end == -1) c_end = document.cookie.length
            return unescape(document.cookie.substring(c_start, c_end))
        }
    }
    return ""
}

/** 20111206 add adimg **/
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
